#include "network/socket_address.h"

#include <string.h> // for memset

namespace network {

SocketAddress::SocketAddress(const base::StringWrapper& ip_address, uint16 port) {
    socket_address_.sin_family = AF_INET;
    socket_address_.sin_port = htons(port);
    socket_address_.sin_addr.s_addr = inet_addr(ip_address.GetString());
    memset(socket_address_.sin_zero, 0, sizeof(socket_address_.sin_zero));
}

} // namespace network
